package com.web.kdl.service.auth;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.web.kdl.common.result.CommonResult;
import com.web.kdl.entity.auth.PermissionInfo;
import com.web.kdl.entity.auth.RoleInfo;
import com.web.kdl.pojo.form.RoleForm;
import com.web.kdl.pojo.form.RoleQueryForm;
import com.web.kdl.pojo.form.RoleUpdateForm;

import java.util.List;

/**
 * @Author： shulibin
 * @Date： 2025/7/30 13:48
 * @Describe：
 */
public interface RoleService {
    List<RoleInfo> listRoles();

    RoleInfo getById(String id);

    List<String> getRolePermissions(String id);

    CommonResult save(RoleForm form);

    CommonResult updateById(RoleUpdateForm form);

    CommonResult removeById(String id);

    CommonResult assignPermissions(String id, List<String> permissionIds);

    Page<RoleInfo> pageRoles(RoleQueryForm queryForm);

    CommonResult removeBatchByIds(List<String> ids);

    /**
     * 移除角色的某个权限
     * @param roleId 角色ID
     * @param permissionId 权限ID
     * @return 移除结果
     */
    CommonResult removePermission(String roleId, String permissionId);
}
